Skip to content

Classify the live corpus tree in native storage capture - #613

Merged
fazpu merged 5 commits into
mainfrom
feat/capture-live-corpus
Nov 14, 2026
Merged

fazpu merged 5 commits into
mainfrom
feat/capture-live-corpus

Conversation

@fazpu

@fazpu fazpu commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Native storage capture now classifies D155's live corpus tree instead of expanding retired snapshot manifests. The original read-only PostgreSQL view supplies recorded documents.corpus_paths and served-document inputs. A folder counts as a document copy only when the nullable publication marker matches the current DB-input/default-policy revision and the recorded set is exactly the desired folder.

  • Separate native classes identify corpus original copies, reader derivatives and navigation. Published documents reference every member-table index, including radix sub-pages, using the same paging output as the renderer. They use the existing projection_origin / p3_origin vocabulary. Canonical raw originals remain canonical_raw / canonical_object, so corpus copies never inflate canonical-original quantities.
  • Expand only known reader files from the hash-bound immutable E0 inventory. Incomplete, updating, stale, forgotten and unrecorded/orphan folders are excluded staging. Unknown keys outside the writer grammar and missing required published files refuse completion.
  • Remove snapshot corpus rules, reads, manifest expansion and the unused tree-locator variant. projection_snapshots remains because /operations.latest_projections still reads its historical metadata; it remains a PostgreSQL allocation resource. No migration is needed. Both native helpers require exact current head p9_52_0073, with no old-head fallback.
  • Bound document pages before joining served inputs and seek through the native UUID index, including UUID zero on the first page. New generated schema/source/native/classification/mapping regression pins come from scripts/generate_storage_capture_fixture.py; both new test files are in the CI inventory.

No converter, chunker, Selection, Claimify, embedding or text-origin identity changes. Publication metadata remains outside paid-work reuse keys. Public wire purposes/components, API schemas and commercial byte bases are unchanged.

Verification

Review fix verification (183b0611a): 169 affected unit tests and 91 PostgreSQL/MinIO tests passed. The integration total includes the 13-case live-tree capture matrix, reader selection/export, real MinIO publication, and all 14 native guard/view tests in fresh dedicated capture_guard_* databases. The new capture regression publishes a folder with 150 additional page-image assets, asserts every generated index has a corpus.navigation reference, and checks every file in the folder is projection_origin rather than staging. It fails against the previous capture implementation and passes with this fix.

Ruff check/format (761 files), Pyright (0 errors/warnings), all 5 import contracts, test inventory and git diff --check pass. The live-corpus profile fixture was regenerated through its generator; capture/OpenAPI/TypeScript contracts, client/parity, D143 defaults and docs generation freshness checks pass. Twelve comparisons against the previous renderer cover small and paginated inventories at member limits 32 and 150: paths, bytes and export revisions are identical, so no builder-policy or paid-work reuse boundary changes.

Earlier full-PR validation, before this review fix:

All PostgreSQL suites ran sequentially on the requested localhost:55433/rememberstack test database, using the running engine PostgreSQL image. Real MinIO tests reused the healthy script-provisioned container at 127.0.0.1:59000.

  • Full unit inventory: 3,577 passed, 11 skipped. Seven skips require PostgreSQL and subsequently passed in the real PostgreSQL P1 suite (17 passed); four require unavailable LibreOffice.
  • Affected PostgreSQL/MinIO suites: 179 passed, 1 expected failure. Covers publication, consumption, forget/restore, lock loss, served-reading selection, migrations/catalog contract, operations, D143 operations, document inventory/search, reuse lifecycle and D140 text origin. The expected failure names the existing D122 reuse-window gap.
  • Final-source capture matrix: 12 passed. Tests every observed object's purpose, original/derivative/navigation native classes, separate raw/corpus original totals, orphan and forgotten copies, cleared/stale/policy-mismatched markers, missing/extra recorded paths, unexpected files, missing published originals, five unknown-key grammars, exact schema refusal and one-row original-view pagination. A nonempty historical snapshot row is deliberately ignored. These capture reruns overlap the broader run and are not additional unique coverage.
  • The final rerun exposed catalog-autovacuum contention: the real NOWAIT guard refused rather than producing evidence. Test setup now vacuums migration-created catalog churn before arming cuts; the final 12-case run passes without changing the production guard or retrying an original cut.
  • Ruff check/format: 762 files; Pyright: 0 errors/warnings; 5 import contracts kept; inventory: 179 unit / 96 integration / 275 discovered files; git diff --check passes.
  • Generated-artifact freshness passed through generators: the new capture fixture, OpenAPI, TypeScript contracts/parity/client, documentation diagrams and llms exports. OpenAPI/client/D143 exports remain unchanged; D143 default/catalogue and real operations fixture tests pass. Documentation truth checks pass. Historical dated qualification receipts are preserved.

The native PostgreSQL sessions and MinIO objects are real. Provider wire in the classification suite is explicitly synthetic; this proves classification and refusal behavior, not deployed FSIT-at-T, production clock/image/cost or commercial enablement.

remember.dev companion integration

No files in writeitai/ultimate-memory-cloud are changed. When it pins this engine:

  1. Update runtime/engine.lock and rebuild the runtime artifact/image. Regenerate the actual engine native.source_digest, expected native.schema_digest, native.schema_profile_digest and native qualification/profile preimages (native.profile_digest) for head p9_52_0073. Include the capture modules, current migration/catalog contract, spine/corpus_export.py served selector, core/corpus_export.py builder policy/revision/reader registry/original naming, model/conversion.py asset-name contract and their source dependency closure. Regenerate managed_runtime_source_digest and the actual producer identity. The committed engine regression fixture uses synthetic test domains and must not be installed as a deployed profile.
  2. Supply that accepted NativeCaptureProfile to runtime/src/umc_runtime/storage_capture_profile.py::managed_capture_profile with the actual existing deployment/database/four filesystem bindings and qualified provider/clock/run inputs. Let the engine regenerate each Project's classification and operator mapping digests, then register/accept the exact new receiver profiles and request identities. The store-binding digest stays the same when its inputs stay the same; preserve old completed evidence under its original identities.
  3. Migrate each Project to p9_52_0073 and reinstall both install_native_relation_guard and install_native_capture_catalog under the existing restricted roles. Requalify actual installed function bytes/owners/search paths/ACLs, native view timing and a nonempty live-tree capture with the real provider before accepting new chargeable evidence. Existing provider/clock/resource bounds change only when their qualification evidence requires it.
  4. Runtime bindings stay the existing raw, artifacts, corpus, forget capabilities and capture_storage_batch call. There is no new store role, callback, corpus manifest reader, scheduler or receiver wire enum. The new included classes map to existing projection_origin / p3_origin; incomplete/orphan copies map to excluded staging.

The implementation handoff is also recorded in docs/development/storage-capture-managed-assembly.md.

Contributor agreement

Signing on behalf of a legal entity (leave blank if accepting individually):

@fazpu
fazpu marked this pull request as ready for review November 14, 2026 00:57
@fazpu
fazpu merged commit af36690 into main Nov 14, 2026
17 checks passed
@fazpu fazpu mentioned this pull request Nov 14, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant